Optimal. Leaf size=112 \[ -\frac {\cosh \left (a+b x-c x^2\right )}{2 c}-\frac {b e^{a+\frac {b^2}{4 c}} \sqrt {\pi } \text {Erf}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{8 c^{3/2}}+\frac {b e^{-a-\frac {b^2}{4 c}} \sqrt {\pi } \text {Erfi}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{8 c^{3/2}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 112, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 5, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.357, Rules used = {5490, 5482,
2266, 2236, 2235} \begin {gather*} -\frac {\sqrt {\pi } b e^{a+\frac {b^2}{4 c}} \text {Erf}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{8 c^{3/2}}+\frac {\sqrt {\pi } b e^{-a-\frac {b^2}{4 c}} \text {Erfi}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{8 c^{3/2}}-\frac {\cosh \left (a+b x-c x^2\right )}{2 c} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2235
Rule 2236
Rule 2266
Rule 5482
Rule 5490
Rubi steps
\begin {align*} \int x \sinh \left (a+b x-c x^2\right ) \, dx &=-\frac {\cosh \left (a+b x-c x^2\right )}{2 c}+\frac {b \int \sinh \left (a+b x-c x^2\right ) \, dx}{2 c}\\ &=-\frac {\cosh \left (a+b x-c x^2\right )}{2 c}+\frac {b \int e^{a+b x-c x^2} \, dx}{4 c}-\frac {b \int e^{-a-b x+c x^2} \, dx}{4 c}\\ &=-\frac {\cosh \left (a+b x-c x^2\right )}{2 c}-\frac {\left (b e^{-a-\frac {b^2}{4 c}}\right ) \int e^{\frac {(-b+2 c x)^2}{4 c}} \, dx}{4 c}+\frac {\left (b e^{a+\frac {b^2}{4 c}}\right ) \int e^{-\frac {(b-2 c x)^2}{4 c}} \, dx}{4 c}\\ &=-\frac {\cosh \left (a+b x-c x^2\right )}{2 c}-\frac {b e^{a+\frac {b^2}{4 c}} \sqrt {\pi } \text {erf}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{8 c^{3/2}}+\frac {b e^{-a-\frac {b^2}{4 c}} \sqrt {\pi } \text {erfi}\left (\frac {b-2 c x}{2 \sqrt {c}}\right )}{8 c^{3/2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.13, size = 134, normalized size = 1.20 \begin {gather*} \frac {-4 \sqrt {c} \cosh (a+x (b-c x))+b \sqrt {\pi } \text {Erfi}\left (\frac {-b+2 c x}{2 \sqrt {c}}\right ) \left (-\cosh \left (a+\frac {b^2}{4 c}\right )+\sinh \left (a+\frac {b^2}{4 c}\right )\right )+b \sqrt {\pi } \text {Erf}\left (\frac {-b+2 c x}{2 \sqrt {c}}\right ) \left (\cosh \left (a+\frac {b^2}{4 c}\right )+\sinh \left (a+\frac {b^2}{4 c}\right )\right )}{8 c^{3/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.24, size = 120, normalized size = 1.07
method | result | size |
risch | \(-\frac {{\mathrm e}^{c \,x^{2}-b x -a}}{4 c}-\frac {b \sqrt {\pi }\, {\mathrm e}^{-\frac {4 a c +b^{2}}{4 c}} \erf \left (x \sqrt {-c}+\frac {b}{2 \sqrt {-c}}\right )}{8 c \sqrt {-c}}-\frac {{\mathrm e}^{-c \,x^{2}+b x +a}}{4 c}-\frac {b \sqrt {\pi }\, {\mathrm e}^{\frac {4 a c +b^{2}}{4 c}} \erf \left (-\sqrt {c}\, x +\frac {b}{2 \sqrt {c}}\right )}{8 c^{\frac {3}{2}}}\) | \(120\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 674 vs.
\(2 (88) = 176\).
time = 0.46, size = 674, normalized size = 6.02 \begin {gather*} -\frac {1}{2} \, x^{2} \sinh \left (c x^{2} - b x - a\right ) + \frac {{\left (\frac {\sqrt {\pi } {\left (2 \, c x - b\right )} b^{2} {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {\frac {{\left (2 \, c x - b\right )}^{2}}{c}}\right ) - 1\right )}}{\sqrt {\frac {{\left (2 \, c x - b\right )}^{2}}{c}} \left (-c\right )^{\frac {5}{2}}} - \frac {4 \, b c e^{\left (-\frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}}{\left (-c\right )^{\frac {5}{2}}} - \frac {4 \, {\left (2 \, c x - b\right )}^{3} \Gamma \left (\frac {3}{2}, \frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}{\left (\frac {{\left (2 \, c x - b\right )}^{2}}{c}\right )^{\frac {3}{2}} \left (-c\right )^{\frac {5}{2}}}\right )} b e^{\left (a + \frac {b^{2}}{4 \, c}\right )}}{32 \, \sqrt {-c}} + \frac {{\left (\frac {\sqrt {\pi } {\left (2 \, c x - b\right )} b^{3} {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {\frac {{\left (2 \, c x - b\right )}^{2}}{c}}\right ) - 1\right )}}{\sqrt {\frac {{\left (2 \, c x - b\right )}^{2}}{c}} \left (-c\right )^{\frac {7}{2}}} - \frac {6 \, b^{2} c e^{\left (-\frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}}{\left (-c\right )^{\frac {7}{2}}} - \frac {12 \, {\left (2 \, c x - b\right )}^{3} b \Gamma \left (\frac {3}{2}, \frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}{\left (\frac {{\left (2 \, c x - b\right )}^{2}}{c}\right )^{\frac {3}{2}} \left (-c\right )^{\frac {7}{2}}} - \frac {8 \, c^{2} \Gamma \left (2, \frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}{\left (-c\right )^{\frac {7}{2}}}\right )} c e^{\left (a + \frac {b^{2}}{4 \, c}\right )}}{32 \, \sqrt {-c}} - \frac {{\left (\frac {\sqrt {\pi } {\left (2 \, c x - b\right )} b^{2} {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {-\frac {{\left (2 \, c x - b\right )}^{2}}{c}}\right ) - 1\right )}}{\sqrt {-\frac {{\left (2 \, c x - b\right )}^{2}}{c}} c^{\frac {5}{2}}} + \frac {4 \, b e^{\left (\frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}}{c^{\frac {3}{2}}} - \frac {4 \, {\left (2 \, c x - b\right )}^{3} \Gamma \left (\frac {3}{2}, -\frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}{\left (-\frac {{\left (2 \, c x - b\right )}^{2}}{c}\right )^{\frac {3}{2}} c^{\frac {5}{2}}}\right )} b e^{\left (-a - \frac {b^{2}}{4 \, c}\right )}}{32 \, \sqrt {c}} + \frac {1}{32} \, {\left (\frac {\sqrt {\pi } {\left (2 \, c x - b\right )} b^{3} {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {-\frac {{\left (2 \, c x - b\right )}^{2}}{c}}\right ) - 1\right )}}{\sqrt {-\frac {{\left (2 \, c x - b\right )}^{2}}{c}} c^{\frac {7}{2}}} + \frac {6 \, b^{2} e^{\left (\frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}}{c^{\frac {5}{2}}} - \frac {12 \, {\left (2 \, c x - b\right )}^{3} b \Gamma \left (\frac {3}{2}, -\frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}{\left (-\frac {{\left (2 \, c x - b\right )}^{2}}{c}\right )^{\frac {3}{2}} c^{\frac {7}{2}}} - \frac {8 \, \Gamma \left (2, -\frac {{\left (2 \, c x - b\right )}^{2}}{4 \, c}\right )}{c^{\frac {3}{2}}}\right )} \sqrt {c} e^{\left (-a - \frac {b^{2}}{4 \, c}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 385 vs.
\(2 (88) = 176\).
time = 0.41, size = 385, normalized size = 3.44 \begin {gather*} -\frac {2 \, c \cosh \left (c x^{2} - b x - a\right )^{2} - \sqrt {\pi } {\left (b \cosh \left (c x^{2} - b x - a\right ) \cosh \left (\frac {b^{2} + 4 \, a c}{4 \, c}\right ) - b \cosh \left (c x^{2} - b x - a\right ) \sinh \left (\frac {b^{2} + 4 \, a c}{4 \, c}\right ) + {\left (b \cosh \left (\frac {b^{2} + 4 \, a c}{4 \, c}\right ) - b \sinh \left (\frac {b^{2} + 4 \, a c}{4 \, c}\right )\right )} \sinh \left (c x^{2} - b x - a\right )\right )} \sqrt {-c} \operatorname {erf}\left (\frac {{\left (2 \, c x - b\right )} \sqrt {-c}}{2 \, c}\right ) - \sqrt {\pi } {\left (b \cosh \left (c x^{2} - b x - a\right ) \cosh \left (\frac {b^{2} + 4 \, a c}{4 \, c}\right ) + b \cosh \left (c x^{2} - b x - a\right ) \sinh \left (\frac {b^{2} + 4 \, a c}{4 \, c}\right ) + {\left (b \cosh \left (\frac {b^{2} + 4 \, a c}{4 \, c}\right ) + b \sinh \left (\frac {b^{2} + 4 \, a c}{4 \, c}\right )\right )} \sinh \left (c x^{2} - b x - a\right )\right )} \sqrt {c} \operatorname {erf}\left (\frac {2 \, c x - b}{2 \, \sqrt {c}}\right ) + 4 \, c \cosh \left (c x^{2} - b x - a\right ) \sinh \left (c x^{2} - b x - a\right ) + 2 \, c \sinh \left (c x^{2} - b x - a\right )^{2} + 2 \, c}{8 \, {\left (c^{2} \cosh \left (c x^{2} - b x - a\right ) + c^{2} \sinh \left (c x^{2} - b x - a\right )\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int x \sinh {\left (a + b x - c x^{2} \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.42, size = 123, normalized size = 1.10 \begin {gather*} -\frac {\frac {\sqrt {\pi } b \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {c} {\left (2 \, x - \frac {b}{c}\right )}\right ) e^{\left (\frac {b^{2} + 4 \, a c}{4 \, c}\right )}}{\sqrt {c}} + 2 \, e^{\left (-c x^{2} + b x + a\right )}}{8 \, c} + \frac {\frac {\sqrt {\pi } b \operatorname {erf}\left (-\frac {1}{2} \, \sqrt {-c} {\left (2 \, x - \frac {b}{c}\right )}\right ) e^{\left (-\frac {b^{2} + 4 \, a c}{4 \, c}\right )}}{\sqrt {-c}} - 2 \, e^{\left (c x^{2} - b x - a\right )}}{8 \, c} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int x\,\mathrm {sinh}\left (-c\,x^2+b\,x+a\right ) \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________